package happensbefore;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2022-08-15 23:36
 **/
public class Demo {

    private volatile int value = 0;

    public int getValue() {
        return value;
    }

    public synchronized void setValue() {
        ++value;
    }
}
